<template>
    <div class="demo-basic">
        <div class="author-demo">
            <div>作者：陈炼</div>
            <div>日期：2017/11/02</div>
        </div>
        <z-title>
            <div slot="z-title">新增维保记录</div>
        </z-title>

        <p>组件已包含返回上一页效果，复制html代码直接使用即可</p>
        <pre style="background-color: #ececec;">
            <code class="html" v-text="htmlCode">
            </code>
        </pre>
    </div>
</template>
<script>
    import hljs from 'highlight.js'
    export default {
        data () {
            return {
                htmlCode: '<z-title>\n' +
                '            <div slot="z-title">新增维保记录</div>\n' +
                '        </z-title>',
            }
        },
        // 组件被挂载的时候执行的方法
        mounted: function () {
            window.setTimeout(function () {
                $('.demo-basic pre code').each(function(i, block) {
                    hljs.highlightBlock(block);
                });
            }, 0);
        }
    }
</script>
